import ajax from './index'
// 小店类型管理
// 增加 /backend/shopCategory/create
export function shopCategoryCreate(condition) {
  return ajax({
    url: '/backend/shopCategory/create',
    method: 'POST',
    data: condition
  });
}
// 删除 /backend/shopCategory/delete
export function shopCategoryDelete(id) {
  return ajax({
    url: `/backend/shopCategory/delete?id=${ID}`,
    method: 'POST'
  });
}
// 修改 /backend/shopCategory/update/{id}
export function shopCategoryUpdate(condition) {
  return ajax({
    url: `/backend/shopCategory/update/${condition.id}`,
    method: 'POST',
    data: condition
  });
}
// 查询 /backend/shopCategory/listAll

export function shopCategoryList(condition) {
  return ajax({
    url: '/backend/shopCategory/listAll',
    method: 'GET',
    data: condition
  });
}

// 小店分类管理
// 增加
export function shopTypeCreate(condition) {
  return ajax({
    url: '/backend/shopType/create',
    method: 'POST',
    data: condition
  });
}
// 删除
export function shopTypeDelete(id) {
  return ajax({
    url: `/backend/shopType/delete?id=${id}`,
    method: 'POST'
  });
}
// 批量删除
export function shopTypeDeleteAll(condition) {
  return ajax({
    url: `/backend/shopType/deleteAll`,
    method: 'POST',
    data: condition
  });
}
// 修改
export function shopTypeUpdate(condition) {
  return ajax({
    url: `/backend/shopType/update/${condition.id}`,
    method: 'POST',
    data: condition
  });
}
// 查询所有
export function shopTypeListAll(condition) {
  return ajax({
    url: '/backend/shopType/listAll',
    method: 'GET',
    data: condition
  });
}
// 分页所有查询
export function shopTypeList(condition) {
  return ajax({
    url: '/backend/shopType/list',
    method: 'GET',
    params: condition
  });
}


// 小店移除记录
// 分页所有
export function shopDeleteList(condition) {
  return ajax({
    url: `/backend/shopDelete/list?${condition}`,
    method: 'GET',
    data: condition
  });
}
// 小店操作日志管理
// 新增
export function adminLogCreate(condition) {
  return ajax({
    url: '/backend/adminLog/create',
    method: 'POST',
    data: condition
  });
}
// 修改
export function adminLogUpdate(condition) {
  return ajax({
    url: `/backend/adminLog/update/${condition.id}`,
    method: 'POST',
    data: condition
  });
}
// 删除
export function adminLogDelete(condition) {
  return ajax({
    url: '/backend/adminLog/delete',
    method: 'POST',
    data: condition
  });
}
// 分页查询
export function adminLogList(condition) {
  return ajax({
    url: `/backend/adminLog/list?${condition}`,
    method: 'GET',
    data: condition
  });
}
// 查询所有
export function adminLogListAll(condition) {
  return ajax({
    url: '/backend/adminLog/listAll',
    method: 'GET',
    data: condition
  });
}
//   结算主体
// 结算主体分页列表
// GET
// export function settlementEntityPageList(condition) {
//   return ajax({
//     url: '/settlementEntity/pageList',
//     method: 'GET',
//     data: condition
//   });
// }
// 更新结算主体
// POST
// export function settlementEntityUpdate(condition) {
//   return ajax({
//     url: '/settlementEntity/update',
//     method: 'POST',
//     data: condition
//   });
// }
// 新增结算主体
// POST
// export function settlementEntityAdd(condition) {
//   return ajax({
//     url: '/settlementEntity/add',
//     method: 'POST',
//     data: condition
//   });
// }
// 详情
// GET
// export function settlementEntityDetail(condition) {
//   return ajax({
//     url: `/settlementEntity/detail/${condition.id}`,
//     method: 'GET',
//     data: condition
//   });
// }
// 删除结算主体
// GET
// export function settlementEntityDelete(condition) {
//   return ajax({
//     url: `/settlementEntity/delete/${ids}`,
//     method: 'GET',
//     data: condition
//   });
// }

// 连锁店手动创建订单
// 分页列表
// GET
export function shopOrderPageList(condition) {
  return ajax({
    url: `/shopOrder/pageList`,
    method: 'GET',
    data: condition
  });
}
// 更新
// POST
export function shopOrderUpdate(condition) {
  return ajax({
    url: '/shopOrder/update',
    method: 'POST',
    data: condition
  });
}
// 新增
// POST
export function shopOrderAdd(condition) {
  return ajax({
    url: '/shopOrder/add',
    method: 'POST',
    data: condition
  });
}
// 详情
// GET
export function shopOrderDetail(condition) {
  return ajax({
    url: `/shopOrder/detail/${condition.id}`,
    method: 'GET',
    data: condition
  });
}
// 删除
// GET
export function shopOrderDelete(condition) {
  return ajax({
    url: `/shopOrder/delete/${condition.ids}`,
    method: 'GET',
    data: condition
  });
}

// 小店收款码管理

// 新增
// POST
export function shopCodeCreate(condition) {
  return ajax({
    url: `/backend/shopCode/create?num=${condition.num}`,
    method: 'POST'
  });
}
// 关联商户
// POST
export function shopCodeUpdate(condition) {
  return ajax({
    url: `/backend/shopCode/update?id=${condition.id}&shopId=${condition.shopId}`,
    method: 'POST',
    // data: condition
  });
}
// 取消关联商户
// POST
export function shopCodeUpdateShopIdDel(condition) {
  return ajax({
    url: `/backend/shopCode/updateShopIdDel?id=${condition.id}&shopId=${condition.shopId}`,
    method: 'POST',
    // data: condition
  });
}
// 分页所有
// GET
export function shopCodeLlist(condition) {
  return ajax({
    url: `/backend/shopCode/list?${condition}`,
    method: 'GET',
    data: condition
  });
}
// 查询关联商户
// POST
export function shopCodeConnectLog(condition) {
  return ajax({
    url: '/backend/shopCode/connectLog?code=' + condition.code,
    method: 'POST',
    data: condition
  });
}


// 小店管理列表
// 小店管理新增列表
// POST
export function sellerSave(condition) {
  return ajax({
    url: '/backend/seller/save',
    method: 'POST',
    data: condition
  });
}
// 小店管理表分页列表
// GET
export function shopPageListShop(condition) {
  return ajax({
    url: `/backend/shop/pageListShop`,
    method: 'GET',
    data: condition
  });
}
// 小店管理原有展示列表
// GET
export function sellerList(condition) {
  return ajax({
    url: `/backend/seller/list`,
    method: 'GET',
    params: condition
  });
}
// 详情
// GET
export function sellerDetail(condition) {
  return ajax({
    url: `/backend/seller/detail/${condition.id}`,
    method: 'GET',
    data: condition
  });
}
// 批量删除小店（旧）
// POST
export function sellerDelete(condition) {
  return ajax({
    url: '/backend/seller/delete',
    method: 'POST',
    data: condition
  });
}
// 小店申请审核根据传入的状态变更审核状态
// POST
export function sellerCheck(condition) {
  return ajax({
    url: '/backend/seller/check',
    method: 'POST',
    data: condition
  });
}
// 小店申请批量审核
// POST
export function sellerCheck2(condition) {
  return ajax({
    url: '/backend/seller/check2',
    method: 'POST',
    data: condition
  });
}
// 小店申请批量审核拒绝
// POST
export function sellerRefuse(condition) {
  return ajax({
    url: '/backend/seller/refuse',
    method: 'POST',
    data: condition
  });
}
// 资金变更增加记录
// POST
export function sellerRecharge(condition) {
  return ajax({
    url: '/backend/seller/recharge',
    method: 'POST',
    data: condition
  });
}
// 资金流水变更列表(旧)
// GET
export function sellerMoney_record_list(condition) {
  return ajax({
    url: `/backend/seller/money_record_list`,
    method: 'GET',
    data: condition
  });
}
// 创建订单
// POST
export function sellerOrder_create(condition) {
  return ajax({
    url: '/backend/seller/order_create',
    method: 'POST',
    data: condition
  });
}
// 订单列表
// GET
export function sellerOrderList(condition) {
  return ajax({
    url: `/backend/seller/orderList?${condition}`,
    method: 'GET'
  });
}
// 订单详情
// GET
export function sellerOrderDetail(condition) {
  return ajax({
    url: `/backend/seller/orderDetail/${condition.id}`,
    method: 'GET',
    data: condition
  });
}
// 订单支付
// POST
export function sellerOrderPay(condition) {
  return ajax({
    url: '/backend/seller/orderPay',
    method: 'POST',
    data: condition
  });
}
// 小店管理表分页列表(新)
// GET
export function sellerPageListShop(condition) {
  return ajax({
    url: `/backend/seller/pageListShop`,
    method: 'GET',
    data: condition
  });
}

// 小店会员表
// 绑定小店会员表
// POST
export function shopVipRelationUpdate(obj) {
  return ajax({
    url: '/backend/shopVipRelation/update',
    method: 'POST',
    data: obj
  });
}
// 生成支付二维码
// GET
export function shopVipRelationGenerateCode(condition) {
  return ajax({
    url: `/backend/shopVipRelation/generateCode`,
    method: 'GET',
    data: condition
  });
}
// 新增小店会员表
// POST
export function shopVipRelationAdd(obj) {
  return ajax({
    url: '/backend/shopVipRelation/add',
    method: 'POST',
    data: obj
  });
}
// 详情
// GET
export function shopVipRelationDetail(id) {
  return ajax({
    url: `/backend/shopVipRelation/detail/${id}`,
    method: 'GET'
  });
}
// 删除小店会员表
// GET
export function shopVipRelationDeleteShopVip(condition) {
  return ajax({
    url: `/backend/shopVipRelation/deleteShopVip/${condition.id}`,
    method: 'GET',
    data: condition
  });
}
// 删除小店表
// GET
export function shopVipRelationDeleteShop(condition) {
  return ajax({
    url: `/backend/shopVipRelation/deleteShop/${condition.id}`,
    method: 'GET',
    data: condition
  });
}
// 小店会员表分页列表
// GET
export function shopVipRelationPageSizeList(condition) {
  return ajax({
    url: `/backend/shopVipRelation/pageSizeList`,
    method: 'GET',
    params: condition
  });
}
// 会员管理查看详情小店列表的查询详情(会员激励)
export function shopVipRelationPageSizeShopDetail(condition) {
  return ajax({
    url: `/backend/shopVipRelation/pageSizeShopDetail`,
    method: 'GET',
    data: condition
  });
}


// 小店入驻审核展示列表
export function sellerListCheck(condition) {
  return ajax({
    url: `/backend/seller/listCheck?${condition}`,
    method: 'GET'
  });
}



// 红包记录


export function shopVipRelationRedpacketList(condition) {
  return ajax({
    url: `/backend/shopVipRelation/redpacketList`,
    method: 'GET',
    params: condition
  });
}

// 小店会员订单
export function shopMallOrderlist(condition) {
  return ajax({
    url: `/backend/shopVipRelation/shopMallOrderlist`,
    method: 'GET',
    params: condition
  });
}

// 爆品管理
export function productHot(condition) {
  return ajax({
    url: `/backend/product/hot`,
    method: 'GET',
    params: condition
  });
}

// 爆品删除

export function hotProductRemove(condition) {
  return ajax({
    url: `/backend/product/hotProductRemove`,
    method: 'GET',
    params: condition
  });
}
// 爆品下架


export function hotProductOffLine(condition) {
  return ajax({
    url: `/backend/product/hotProductOffLine`,
    method: 'GET',
    params: condition
  });
}
// 爆品详情

export function hotProductDetail(id) {
  return ajax({
    url: `/backend/product/hot/${id}`,
    method: 'GET',
    // params: condition
  });
}
// 会员专享商品管理
export function vipProductList(condition) {
  return ajax({
    url: `/backend/product/vipProductList`,
    method: 'GET',
    params: condition
  });
}
// 会员专享商品下架
export function vipProductOffLine(condition) {
  return ajax({
    url: `/backend/product/vipProductOffLine`,
    method: 'GET',
    params: condition
  });
}
// 会员专享商品删除
export function vipProductRemove(condition) {
  return ajax({
    url: `/backend/product/vipProductRemove`,
    method: 'GET',
    params: condition
  });
}

// 乐粉/backend/seller/detailLeFen/{uid}
export function detailLeFen(query, uid) {
  return ajax({
    url: `/backend/seller/detailLeFen/${uid}`,
    method: 'GET',
    params: query
  });
}
// 小店会员
export function detailShopPersonVip(query, id) {
  return ajax({
    url: `/backend/seller/detailShopPersonVip/${id}`,
    method: 'GET',
    params: query
  });
}
// 小店员工
export function detailShopPerson(id, query) {
  return ajax({
    url: `/backend/seller/detailShopPerson/${id}`,
    method: 'GET',
    params: query
  });
}
// 开卡记录
export function detailShopVipCard(id, query) {
  return ajax({
    url: `/backend/seller/detailShopVipCard/${id}`,
    method: 'GET',
    params: query
  });
}

// /backend/seller/detailProduct/{id}
// 商品记录
export function detailProduct(id, query) {
  return ajax({
    url: `/backend/seller/detailProduct/${id}`,
    method: 'GET',
    params: query
  });
}

// 资金流水变更列表(旧)

export function money_record_list(id) {
  return ajax({
    url: `/backend/seller/money_record_list`,
    method: 'GET'
  });
}

// /backend/settlementEntity/pageList

export function settlementEntity(query) {
  return ajax({
    url: `/backend/settlementEntity/pageList`,
    method: 'GET',
    params: query
  });
}

// 更新结算主体
export function settlementEntityUpdate(data) {
  return ajax({
    url: `/backend/settlementEntity/update`,
    method: 'POST',
    data: data
  });
}
// 新增结算主体

export function settlementEntityAdd(data) {
  return ajax({
    url: `/backend/settlementEntity/add`,
    method: 'POST',
    data: data
  });
}
// 详情
export function settlementEntityDetail(id) {
  return ajax({
    url: `/backend/settlementEntity/detail/${id}`,
    method: 'GET'
  });
}
// 删除结算主体

export function settlementEntityDelete(ids) {
  return ajax({
    url: `/backend/settlementEntity/delete/${ids}`,
    method: 'GET'
  });
}

// 小店红包使用记录
export function redPacketsendRecordpageList(query) {
  return ajax({
    url: `/backend/redPacket/sendRecord/pageList`,
    method: 'POST',
    data: query
  });
}

// 店铺样式


export function updateShopStyle(query) {
  return ajax({
    url: `/backend/seller/updateShopStyle?${query}`,
    method: 'POST',
    // data: query
  });
}

// 小店红包充值记录
export function listByRedPacketId(redPacketId) {
  return ajax({
    url: `/backend/redPacket/receiveRecord/listByRedPacketId/${redPacketId}`,
    method: 'POST',
    // data: query
  });
}


// 通用红包 充值记录


export function orderCommonList(query) {
  return ajax({
    url: `/backend/order/commonList`,
    method: 'POST',
    data: query
  });
}


// 小店相册审核分页列表
export function albumReviewPageList(data) {
  return ajax({
    url: `/backend/seller/albumReviewPageList`,
    method: 'GET',
    params: data
  });
}
// 相册审核
export function albumReview(query) {
  return ajax({
    url: `/backend/seller/albumReview?${query}`,
    method: 'POST',
    // data: query
  });
}

// 优惠券

export function addProductCoupon(query) {
  return ajax({
    url: `/backend/cashCoupon/add`,
    method: 'POST',
    data: query
  });
}
export function updateProductCoupon(query) {
  return ajax({
    url: `/backend/cashCoupon/update`,
    method: 'POST',
    data: query
  });
}

export function productCouponList(query) {
  return ajax({
    url: `/backend/cashCoupon/pageList`,
    method: 'get',
    params: query
  });
}
export function productCouponIdDelete(ids) {
  return ajax({
    url: `/backend/cashCoupon/delete/${ids}`,
    method: 'GET'
  });
}
export function productCouponIsEnableUpdate(query) {
  return ajax({
    url: `/backend/cashCoupon/update`,
    method: 'POST',
    data: query
  });
}
export function cashCouponDetail(id) {
  return ajax({
    url: `/backend/cashCoupon/detail/${id}`,
    method: 'GET'
  });
}

export function updateBindsProduct(query, id) {
  return ajax({
    url: `/backend/cashCoupon/updateBindsProduct/${id}`,
    method: 'GET',
    params: query
  });
}

